package com.zyd.mappers;

import com.zyd.io.model.MealEntity;
import com.zyd.io.model.MealEntityExample;
import com.zyd.io.model.MealEntityKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface MealEntityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @SelectProvider(type=MealEntitySqlProvider.class, method="countByExample")
    long countByExample(MealEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @DeleteProvider(type=MealEntitySqlProvider.class, method="deleteByExample")
    int deleteByExample(MealEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @Delete({
            "delete from zydzn_meal",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(MealEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @Insert({
            "insert into zydzn_meal (id, vehicle_id, ",
            "accident, thirdduty, ",
            "theftdutp, meal_id, ",
            "create_time, meal_money, ",
            "has_accient, has_thirdduty, ",
            "has_theftdutp, start_time, ",
            "end_time, meal_name)",
            "values (#{id,jdbcType=VARCHAR}, #{vehicle_id,jdbcType=VARCHAR}, ",
            "#{accident,jdbcType=VARCHAR}, #{thirdduty,jdbcType=VARCHAR}, ",
            "#{theftdutp,jdbcType=VARCHAR}, #{meal_id,jdbcType=VARCHAR}, ",
            "#{create_time,jdbcType=VARCHAR}, #{meal_money,jdbcType=DECIMAL}, ",
            "#{has_accient,jdbcType=INTEGER}, #{has_thirdduty,jdbcType=INTEGER}, ",
            "#{has_theftdutp,jdbcType=INTEGER}, #{start_time,jdbcType=VARCHAR}, ",
            "#{end_time,jdbcType=VARCHAR}, #{meal_name,jdbcType=VARCHAR})"
    })
    int insert(MealEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @InsertProvider(type=MealEntitySqlProvider.class, method="insertSelective")
    int insertSelective(MealEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @SelectProvider(type=MealEntitySqlProvider.class, method="selectByExample")
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="vehicle_id", property="vehicle_id", jdbcType=JdbcType.VARCHAR),
            @Result(column="accident", property="accident", jdbcType=JdbcType.VARCHAR),
            @Result(column="thirdduty", property="thirdduty", jdbcType=JdbcType.VARCHAR),
            @Result(column="theftdutp", property="theftdutp", jdbcType=JdbcType.VARCHAR),
            @Result(column="meal_id", property="meal_id", jdbcType=JdbcType.VARCHAR),
            @Result(column="create_time", property="create_time", jdbcType=JdbcType.VARCHAR),
            @Result(column="meal_money", property="meal_money", jdbcType=JdbcType.DECIMAL),
            @Result(column="has_accient", property="has_accient", jdbcType=JdbcType.INTEGER),
            @Result(column="has_thirdduty", property="has_thirdduty", jdbcType=JdbcType.INTEGER),
            @Result(column="has_theftdutp", property="has_theftdutp", jdbcType=JdbcType.INTEGER),
            @Result(column="start_time", property="start_time", jdbcType=JdbcType.VARCHAR),
            @Result(column="end_time", property="end_time", jdbcType=JdbcType.VARCHAR),
            @Result(column="meal_name", property="meal_name", jdbcType=JdbcType.VARCHAR)
    })
    List<MealEntity> selectByExample(MealEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @Select({
            "select",
            "id, vehicle_id, accident, thirdduty, theftdutp, meal_id, create_time, meal_money, ",
            "has_accient, has_thirdduty, has_theftdutp, start_time, end_time, meal_name",
            "from zydzn_meal",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="vehicle_id", property="vehicle_id", jdbcType=JdbcType.VARCHAR),
            @Result(column="accident", property="accident", jdbcType=JdbcType.VARCHAR),
            @Result(column="thirdduty", property="thirdduty", jdbcType=JdbcType.VARCHAR),
            @Result(column="theftdutp", property="theftdutp", jdbcType=JdbcType.VARCHAR),
            @Result(column="meal_id", property="meal_id", jdbcType=JdbcType.VARCHAR),
            @Result(column="create_time", property="create_time", jdbcType=JdbcType.VARCHAR),
            @Result(column="meal_money", property="meal_money", jdbcType=JdbcType.DECIMAL),
            @Result(column="has_accient", property="has_accient", jdbcType=JdbcType.INTEGER),
            @Result(column="has_thirdduty", property="has_thirdduty", jdbcType=JdbcType.INTEGER),
            @Result(column="has_theftdutp", property="has_theftdutp", jdbcType=JdbcType.INTEGER),
            @Result(column="start_time", property="start_time", jdbcType=JdbcType.VARCHAR),
            @Result(column="end_time", property="end_time", jdbcType=JdbcType.VARCHAR),
            @Result(column="meal_name", property="meal_name", jdbcType=JdbcType.VARCHAR)
    })
    MealEntity selectByPrimaryKey(MealEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @UpdateProvider(type=MealEntitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MealEntity record, @Param("example") MealEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @UpdateProvider(type=MealEntitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MealEntity record, @Param("example") MealEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @UpdateProvider(type=MealEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MealEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_meal
     *
     * @mbg.generated Sun Nov 11 17:09:15 CST 2018
     */
    @Update({
            "update zydzn_meal",
            "set vehicle_id = #{vehicle_id,jdbcType=VARCHAR},",
            "accident = #{accident,jdbcType=VARCHAR},",
            "thirdduty = #{thirdduty,jdbcType=VARCHAR},",
            "theftdutp = #{theftdutp,jdbcType=VARCHAR},",
            "meal_id = #{meal_id,jdbcType=VARCHAR},",
            "create_time = #{create_time,jdbcType=VARCHAR},",
            "meal_money = #{meal_money,jdbcType=DECIMAL},",
            "has_accient = #{has_accient,jdbcType=INTEGER},",
            "has_thirdduty = #{has_thirdduty,jdbcType=INTEGER},",
            "has_theftdutp = #{has_theftdutp,jdbcType=INTEGER},",
            "start_time = #{start_time,jdbcType=VARCHAR},",
            "end_time = #{end_time,jdbcType=VARCHAR},",
            "meal_name = #{meal_name,jdbcType=VARCHAR}",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MealEntity record);
}